import Mock from 'mockjs'

const pmmls = Mock.mock('/manager/pmml/list?page=0', {
  "code": 0,
  "message": "pmml文件列表",
  "result": {
      "list": [
        {
          "id": 1,
          "name": "泉州公安",
          "category": "spark",
          "description": "xxxssssssss",
          "filePath": "/root/xxx",
          "isShare": true,
          "createTime": "2021-03-12",
          "updateTime": "2021-03-12"
        },
        {
          "id": 2,
          "name": "贵州公安",
          "category": "pmml",
          "description": "xxx",
          "filePath": "/opt/xxx",
          "isShare": true,
          "createTime": "2021-03-12",
          "updateTime": "2021-03-12"
        },
        {
          "id": 3,
          "name": "泉州公安",
          "category": "spark",
          "description": "xxx",
          "filePath": "/root/xxx",
          "isShare": false,
          "createTime": "2021-03-12",
          "updateTime": "2021-03-12"
        }
      ],
      total_count: 3
  }
})

const menu = Mock.mock('/home/menus', {
  "code": 0,
  "message": "菜单列表",
  "result": {
      data: [
              {
                  title:'首页监控',
                  key:'/'
              },
              {
                  title:'模型训练',
                  key:'/training'
              },
              {
                  title:'模型管理',
                  key:'/pmml'
              },
              {
                  title:'调度服务',
                  key:'/service'
              }
            ]
  }
})

const services = Mock.mock('/manager/model/services', {
  "code": 0,
  "message": "服务列表",
  "result": {
      data: [
              {
                  id: '001',
                  name: 'default',
                  subMenu: [
                    {
                      id: 'sub_001',
                      name: '服务一'
                    },
                    {
                      id: 'sub_002',
                      name: '服务二'
                    },
                    {
                      id: 'sub_003',
                      name: '服务二'
                    },
                    {
                      id: 'sub_004',
                      name: '服务二'
                    },
                    {
                      id: 'sub_005',
                      name: '服务二'
                    },
                    {
                      id: 'sub_006',
                      name: '服务二'
                    }
                  ]
              },
              {
                  id:'002',
                  name: '项目一',
                  subMenu: [
                    {
                      id: 'sub_003',
                      name: '服务三'
                    },
                    {
                      id: 'sub_002',
                      name: '服务二'
                    }
                  ]
              },
              {
                  id:'003',
                  name: '项目二',
                  subMenu: [
                    {
                      id: 'sub_001',
                      name: '服务一'
                    },
                    {
                      id: 'sub_002',
                      name: '服务二'
                    },
                    {
                      id: 'sub_003',
                      name: '服务二'
                    },
                    {
                      id: 'sub_004',
                      name: '服务二'
                    }
                  ]
              }
            ]
  }
})

const createPmml = Mock.mock('/manager/pmml/file', function(options){

  console.log("post请求内容==>", options)

  return Mock.mock({
    "code": 0,
    "message": "创建成功",
    "result": null
  })
})

export default {
  pmmls,
  menu,
  createPmml,
  services
}